package com.macro.mall.tiny.common.example;


/**
 * @author: i_kun
 * @Desc: o_。
 * @create: 2025-06-25 16:46
 */

public class SHA256Example {
    public static void main(String[] args) throws Exception {
//        String data = "SensitiveData123";
//
//        // 计算SHA-256摘要
//        byte[] digest = calculateSHA256(data);
//        String hexDigest = HexFormat.of().formatHex(digest);
//
//        System.out.println("原始数据: " + data);
//        System.out.println("SHA-256摘要: " + hexDigest);
//    }
//
//    public static byte[] calculateSHA256(String data) throws Exception {
//        MessageDigest digest = MessageDigest.getInstance("SHA-256");
//        return digest.digest(data.getBytes("UTF-8"));
    }
}
